---
id: running_flutter
title: Running Flutter
---

import { Callout } from "nextra/components";

# Running Flutter

FVM provides proxy commands to run Flutter and Dart with the correct SDK version for your project.

## Proxy Commands

### Flutter

```bash
fvm flutter <command>
```

### Dart

```bash
fvm dart <command>
```

<Callout type="info">

**Tip:** Create aliases for convenience:

```bash
alias f="fvm flutter"
alias d="fvm dart"
```

</Callout>

## SDK Resolution Order

When you run `fvm flutter` or `fvm dart`, FVM looks for the SDK in this order:

1. Project `.fvmrc` file
2. Ancestor directory `.fvmrc`
3. Global version (`fvm global`)
4. System PATH Flutter

## Direct SDK Access

You can also call the SDK directly using the symlink:

```bash
.fvm/flutter_sdk/bin/flutter run
```

## Spawn Command

Run commands with any installed Flutter version:

```bash
fvm spawn 3.19.0 doctor
```

<Callout type="info">

If you wish to reroute `flutter` and `dart` calls to FVM, i.e., ensure that running `flutter` on the terminal internally runs `fvm flutter`, then you could run the below commands.

**On Mac**

```bash
sudo echo 'fvm flutter ${@:1}' > "/usr/local/bin/flutter" && sudo chmod +x /usr/local/bin/flutter
sudo echo 'fvm dart ${@:1}' > "/usr/local/bin/dart" && sudo chmod +x /usr/local/bin/dart
```

**On Linux**

```bash
echo 'fvm flutter ${@:1}' > "$HOME/.local/bin/flutter" && chmod +x "$HOME/.local/bin/flutter"
echo 'fvm dart ${@:1}' > "$HOME/.local/bin/dart" && chmod +x "$HOME/.local/bin/dart"
```

If you've installed flutter/dart using native package managers, the binaries might conflict with these new shortcuts, so consider deleting the existing ones and taking a backup for easier restoration.

If you wish to remove these reroutes, just delete the corresponding files as shown below:

**On Mac**

```bash
sudo rm /usr/local/bin/flutter
sudo rm /usr/local/bin/dart
```

**On Linux**

```bash
rm "$HOME/.local/bin/flutter"
rm "$HOME/.local/bin/dart"
```

</Callout>

## Spawn Command

Spawns a command on any installed Flutter SDK.

```bash
fvm spawn {version}
```

## Examples

The following will run `flutter analyze` on the `master` channel:

```bash
fvm spawn master analyze
```